package com.coolrui.domain.order.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.coolrui.domain.statemachine.enums.OrderPayState;
import com.coolrui.domain.statemachine.enums.OrderState;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

@Data
public class UserOrder implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId
    private Long orderId;
    private Long shopId;
    private Long userId;
    private String userName;
    private String userMobile;
    private Integer userCity;
    private String userAddress;
    private String orderGoods;
    private BigDecimal orderPrice;
    private Integer orderStatus;
    private Integer payStatus;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;

    // 构造函数
    public UserOrder() {
        this.orderStatus = OrderState.INIT.getCode();
        this.payStatus = OrderPayState.UNPAID.getCode();
        this.createTime = new Date();
        this.updateTime = new Date();
    }
}